package space.sakana.edusysback.entity.question;

import space.sakana.edusysback.entity.question.type.*;
import space.sakana.edusysback.util.TimeUtil;

public class Question {
    private int id;
    private String title;
    private int type;
    private int sid;
    private int create;
    private int tid;
    private int diff;
    private QuestionBase questionBase;

    public Question(int id, String title, int type, int sid, int create, int tid, int diff) {
        this.id = id;
        this.title = title;
        this.type = type;
        this.sid = sid;
        this.create = create;
        this.tid = tid;
        this.diff = diff;
    }

    public Question(String title, int type, int sid, int create, int tid, int diff) {
        this.title = title;
        this.type = type;
        this.sid = sid;
        this.create = create;
        this.tid = tid;
        this.diff = diff;
    }

    public Question(SingleChoice choice, int diff){
        this.title = choice.getTitle();
        this.create = TimeUtil.getTimeStamp();
        this.sid = choice.getSid();
        this.diff = diff;
    }

    public Question(EssayQuestion choice, int diff){
        this.title = choice.getTitle();
        this.create = TimeUtil.getTimeStamp();
        this.sid = choice.getSid();
        this.diff = diff;
    }

    public Question(TrueFalseQ choice, int diff){
        this.title = choice.getTitle();
        this.create = TimeUtil.getTimeStamp();
        this.sid = choice.getSid();
        this.diff = diff;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getSid() {
        return sid;
    }

    public void setSid(int sid) {
        this.sid = sid;
    }

    public int getCreate() {
        return create;
    }

    public void setCreate(int create) {
        this.create = create;
    }

    public int getTid() {
        return tid;
    }

    public void setTid(int tid) {
        this.tid = tid;
    }

    public int getDiff() {
        return diff;
    }

    public void setDiff(int diff) {
        this.diff = diff;
    }

    public QuestionBase getQuestionBase() {
        return questionBase;
    }

    public void setQuestionBase(QuestionBase questionBase) {
        this.questionBase = questionBase;
    }
}
